class @AdminCategoryRoutes extends Backbone.Router

    routes:
        "Categories/Create": "Create"
        "Categories/Edit*path": "Edit"
        "Categories/Listing*path": "Listing"
        "Categories/Index*": "Listing"
        "Categories": "Listing"

    Create: ->
        model = new AdminCategoryCreateModel()
        view = new AdminCategoryCreateView({ model: model })
        view.render()

    Edit: (path) ->
        model = new AdminCategoryEditModel()
        model.set("CategoryId", Url.GetParameterByName("CategoryId"))
        view = new AdminCategoryEditView({ model: model })

    Listing: (path) ->
        model = new AdminCategoryListingModel()
        model.FillModelFromUrl()
        view = new AdminCategoryListingView(model: model)
